//
//  GPUMatter.h
//  GPUMatter
//
//  Created by young on 17/4/14.
//  Copyright © 2017年 young. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

//! Project version number for GPUMatter.
FOUNDATION_EXPORT double GPUMatterVersionNumber;

//! Project version string for GPUMatter.
FOUNDATION_EXPORT const unsigned char GPUMatterVersionString[];

typedef enum : NSUInteger {
    GPUMattingModeGreen,
    GPUMattingModeBlue,
    GPUMattingModeInvalid
} GPUMattingMode;

@interface GPUMatter : NSObject

@property (nonatomic, assign) CGFloat transparency; //透明度

@property (nonatomic, assign) GPUMattingMode mode; //模式

@property (nonatomic, assign) BOOL GaussianEnable; //高斯模糊开关

+ (GPUMatter *)defaultMatter; //初始化单例

- (void)setAuthKey:(NSString *)authKey; //鉴权

- (void)matsampleBuffer:(CMSampleBufferRef)sampleBuffer; //处理原生CMSampleBufferRef数据

- (void)matPixelBuffer:(CVPixelBufferRef)pixelBuffer; //处理原生CVPixelBufferRef数据

- (void)matBGRABytes:(void *)bytes size:(CGSize)size; //处理BGRA格式byte数据

- (void)matYUV420SPWithYbuffer:(char* )ybuffer
                      UVbuffer:(char* )uvbuffer
                         Width:(int)width
                        Height:(int)height
                        isNV12:(BOOL)isNV12; //处理YUV420SP(NV12/NV21)格式byte数据

- (void)matYUV420SPWithBytes:(char* )bytes
                       Width:(int)width
                      Height:(int)height
                      isNV12:(BOOL)isNV12; //处理YUV420SP(NV12/NV21)格式byte数据

- (void)matYUV420PWithYbuffer:(char* )ybuffer
                      Ubuffer:(char* )ubuffer
                      Vbuffer:(char* )vbuffer
                        Width:(int)width
                       Height:(int)height; //处理YUV420P(YV12/I420)格式byte数据

- (void)matYUV420PWithBytes:(char* )bytes
                      Width:(int)width
                     Height:(int)height
                     isI420:(BOOL)isI420; //处理YUV420P(YV12/I420)格式byte数据

- (void)updateBackImageWithBytes:(GLubyte *)bytes size:(CGSize)size; //更新背景图片，接受RGBA格式byte数据

- (void)updateBackImageWithImage:(UIImage *)image; //更新背景图片，接受UIImage数据

@end

